<?php

class ShiftDayTable extends Doctrine_Table {

    public function findShiftForDay($shift_id, $cdate) {
        $dow = date('N', strtotime($cdate));
//        $q = $this->createQuery('sd')
//                        ->where('sd.shift_id = ?', $shift_id)
//                        ->andWhere('sd.dayofweek = ?', $dow);
        $shift = $this->findByShiftIdAndDayofweek($shift_id, $dow);
        //TODO Verificar que no se devuelva más de uno
        return $shift[0];
        //$shift = $this->find(1);
        //return $q->execute();
    }

}
